﻿#ifndef MapH
#define MapH

#include <iostream>
#include "LineFinder.h"

class Map
{
private:
	Cell mapTemp[maxN][maxN];
    int maxFlagLen;
	int readALine(Flags& fl, std::istream& fs);
	void rotate90();

protected:
	void mapClear();
	// rowPoint, colPoint  返回行列的工作区指针。prep : 0 准备工作区 ， 1 回写
	Cell* rowPoint(int row, int prep);
	Cell* colPoint(int col, int prep);

public:
	Cell map[maxN][maxN];
    int cols, rows, maxColFlagLen, maxRowFlagLen;     // maxFlagLen : UI 使用
	Flags colFlags[maxN], rowFlags[maxN];
	int readFromFile(const char* fn);
	void print(std::ostream& stream);
};

#endif

